<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../assets/css/base.css">
  <style>
    div {
      transform-style: preserve-3d;
      perspective: 1000px;
    }

    img {
      transition: all 1s;
    }

    .rotate:hover img {
      /* 单位：deg */
      transform: rotate(180deg);
    }

    .transform-origin img {
      /*
        原点
        transform-origin: 水平方向 垂直方向;
         ● 方位名词
         ● 相对于当前元素的百分比
         ● 具体值
       */
      transform-origin: top left;
    }

    .rotate-x:hover img {
      transform: rotateX(180deg);
    }

    .rotate-y:hover img {
      transform: rotateY(180deg);
    }

    .rotate-z:hover img {
      transform: rotateZ(180deg);
    }

    .rotate3d:hover img {
      /*
        rotate3d(x, y, z, 旋转度数)
         ● x, y, z 用于确定旋转的中心轴，取值 [-1, 1]
       */
      transform: rotate3d(1, 1, 0, 180deg);
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10 rotate">
    <p class="title">rotate</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>

  <div class="float-left margin-left-10 transform-origin rotate">
    <p class="title">transform-origin</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>

  <div class="float-left margin-left-10 rotate-x">
    <p class="title">rotateX</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>

  <div class="float-left margin-left-10 rotate-y">
    <p class="title">rotateY</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>

  <div class="float-left margin-left-10 rotate-z">
    <p class="title">rotateZ</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>

  <div class="float-left margin-left-10 rotate3d">
    <p class="title">rotate3d</p>
    <img src="../../assets/images/Cheems.jpg">
  </div>
</body>

</html>